<!-- 大师配置表表单弹窗 -->
<form id="teacherconfig-form" lay-filter="teacherconfig-form" class="layui-form model-form" style="overflow:auto; height:500px;width:90%;">
    <input name="id" type="hidden"/>
    				    <div class="layui-form-item">
        <label class="layui-form-label">会员名称</label>
        <div class="layui-input-block">
            <input name="memberId" placeholder="请输入会员ID" type="hidden" class="layui-input" maxlength="20"  id="memberId"
                   lay-verify="required" required/>
            <input name="memberName" placeholder="请输入会员ID" type="text" class="layui-input" maxlength="20"  id="memberName"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">大师名称</label>
        <div class="layui-input-block">
            <input name="teacherId" placeholder="请输入大师ID" type="hidden" class="layui-input" maxlength="20"  id="teacherId"
                   lay-verify="required" required/>
            <input name="teacherName" placeholder="请输入大师ID" type="text" class="layui-input" maxlength="20"  id="teacherName"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">提问价格</label>
        <div class="layui-input-block">
            <input name="askPrice" placeholder="请输入提问价格" type="text" class="layui-input" maxlength="20"  id="askPrice"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">电话提问价格</label>
        <div class="layui-input-block">
            <input name="phonePrice" placeholder="请输入电话提问价格" type="text" class="layui-input" maxlength="20"  id="phonePrice"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">是否加入闪问自己</label>
        <div class="layui-input-block">
            <input name="joinQuickAsk" placeholder="请输入是否加入闪问自己，0-不加入，1-加入" type="hidden" class="layui-input" maxlength="20"  id="joinQuickAsk"
                   lay-verify="required" required/>
            <input name="strJoinQuickAsk" placeholder="请输入是否加入闪问自己，0-不加入，1-加入" type="text" class="layui-input" maxlength="20"  id="strJoinQuickAsk"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">是否接受免费追问</label>
        <div class="layui-input-block">
            <input name="acceptFreeReask" placeholder="请输入是否接受免费追问，0-不接受，1-接收" type="hidden" class="layui-input" maxlength="20"  id="acceptFreeReask"
                   lay-verify="required" required/>
            <input name="strAcceptFreeReask" placeholder="请输入是否接受免费追问，0-不接受，1-接收" type="text" class="layui-input" maxlength="20"  id="strAcceptFreeReask"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">接受免费追问的次数</label>
        <div class="layui-input-block">
            <input name="freeReaskTimes" placeholder="请输入接受免费追问的次数" type="text" class="layui-input" maxlength="20"  id="freeReaskTimes"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">创建日期</label>
        <div class="layui-input-block">
            <input name="createDate" placeholder="请输入创建日期" type="text" class="layui-input" maxlength="20"  id="createDate"
                   lay-verify="required" readonly required/>
        </div>
    </div>
     <div class="layui-form-item model-form-footer">
        <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button>
        <!--<button class="layui-btn" lay-filter="user-form-submit" lay-submit>保存</button>-->
    </div>
</form>

<script>
    layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
        var layer = layui.layer;
        var admin = layui.admin;
        var form = layui.form;
        var formSelects = layui.formSelects;
 
        var teacherconfig = admin.getTempData('t_teacherconfig');
           if (teacherconfig.method=="update"){
               if(teacherconfig.joinQuickAsk==0){
                   teacherconfig.strJoinQuickAsk="不加入";
               }else  if(teacherconfig.joinQuickAsk==1){
                   teacherconfig.strJoinQuickAsk="加入";
               }
               if(teacherconfig.acceptFreeReask==0){
                   teacherconfig.strAcceptFreeReask="不接受";
               }else if(teacherconfig.acceptFreeReask==1){
                   teacherconfig.strAcceptFreeReask="接受";
               }
        	form.val('teacherconfig-form', teacherconfig);
            form.render();
        }
        // 表单提交事件
        form.on('submit(user-form-submit)', function (data) {
             layer.load(2);
            
            admin.req('teacher/teacherconfig/'+teacherconfig.method, JSON.stringify(data.field), function (data) {
                layer.closeAll('loading');
                if (data.code == 0) {
                    layer.msg(data.msg, {icon: 1, time: 500});
                    admin.finishPopupCenter();
                } else {
                    layer.msg(data.msg, {icon: 2, time: 500});
                }
            }, "post");  
            return false;
        });
    });
</script>
